<div class="modal-dialog" role="document" ng-controller="modalAdd">
	<div class="modal-content">
		<div class="modal-header">
			<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true"  ng-click="close()">&times;</span></button>
			<h4 class="modal-title" id="myModalLabel">用户添加</h4>
		</div>

		<div class="modal-body">

			<form class="form-horizontal" ng-submit="submit()" name="userform" novalidate="novalidate">
				<input type="hidden" ng-model="formData.id">
				<div class="form-group">
					<label for="inputUserName3" class="col-sm-2 control-label">用户名</label>
					<div class="col-sm-10">
						<input type="text" class="form-control" id="inputUserName3" name="userId" required ng-model="formData.userId" ng-class="{true: 'c1', false: ''}[userform.userId.$dirty && userform.userId.$invalid]">
						<span style="color:red" ng-show="userform.userId.$dirty && userform.userId.$invalid">
									<span ng-show="userform.userId.$error.required">用户名是必须的</span>
						</span>
					</div>
				</div>
				<div class="form-group">
					<label for="inputName3" class="col-sm-2 control-label">姓名</label>
					<div class="col-sm-10">
						<input type="text" class="form-control" id="inputNmae3" name="userName"
							ng-minlength="2" ng-maxlength="5"ng-model="formData.userName"
							 ng-class="{true: 'c1', false: ''}[userform.userName.$dirty && userform.userName.$invalid]">
						<span style="color:red" ng-show="userform.userName.$dirty && userform.userName.$invalid">
									<span ng-show="userform.userName.$error.required">邮箱是必须的。</span>
						<span ng-show="userform.userName.$error.minlength">名字最少2位</span>
						<span ng-show="userform.userName.$error.maxlength">名字最多5位</span>
						</span>

					</div>
				</div>
				<div class="form-group">
					<label for="inputsex3" class="col-sm-2 control-label">性别</label>

					<div class="col-sm-10">
						<div class="radio">
							<label>
									      <input type="radio" name="sex" id="optionsRadios1"
									         value="男" ng-model="formData.sex"
									         style="position: relative;bottom: 3px;"> 男
									   </label>
						</div>
						<div class="radio">
							<label>
						      <input type="radio" name="sex" id="optionsRadios2"
						         value="女" ng-model="formData.sex"
						         style="position: relative;bottom: 3px;">女
						  	</label>
						</div>
					</div>
				</div>
				<div class="form-group">
					<label for="inputSj3" class="col-sm-2 control-label">手机号</label>
					<div class="col-sm-10">
						<input type="text" class="form-control" id="inputSj3" required
							ng-pattern="/^[0-9]*$/" ng-model="formData.phoneNum" ng-minlength="11"
							 ng-maxlength="11" name="phoneNum"
							 ng-class="{true: 'c1', false: ''}[userform.phoneNum.$dirty && userform.phoneNum.$invalid]">
						<span style="color:red" ng-show="userform.phoneNum.$dirty && userform.phoneNum.$invalid">
							<span ng-show="userform.phoneNum.$error.required">手机号是必须的。</span>
							<span ng-show="userform.phoneNum.$error.pattern">必须是数字</span>
							<span ng-show="userform.phoneNum.$error.minlength">请正确输入手机号</span>
							<span ng-show="userform.phoneNum.$error.maxlength">请正确输入手机号</span>
						</span>

					</div>
				</div>
				<div class="form-group">
					<label for="inputEmail3" class="col-sm-2 control-label">邮箱</label>
					<div class="col-sm-10">
						<input type="email" class="form-control" id="inputEmail3" name="email"
							 ng-model="formData.email" ng-class="{true: 'c1', false: ''}
									[userform.email.$dirty && userform.email.$invalid]" required>
						<span style="color:red" ng-show="userform.email.$dirty && userform.email.$invalid">
							<span ng-show="userform.email.$error.required">邮箱是必须的。</span>
							<span ng-show="userform.email.$error.email">非法的邮箱地址。</span>
						</span>
					</div>
				</div>
				<div class="form-group">
					<label for="inputdizhi3" class="col-sm-2 control-label">地址</label>
					<div class="col-sm-10">
						<input type="text" class="form-control" id="inputdizhi3" name="address" required ng-maxlength="100" ng-model="formData.address" ng-class="{true: 'c1', false: ''}
									[userform.address.$dirty && userform.address.$invalid]">
						<span style="color:red" ng-show="userform.address.$dirty && userform.address.$invalid">
									<span ng-show="userform.email.$error.required">地址是必须的。</span>
						<span ng-show="userform.address.$error.maxlength">非法的地址</span>
						</span>
					</div>
				</div>
				<div class="form-group">
					<button type="submit" class=" col-sm-2 btn btn-primary" style="margin: 20px 42%;"
						ng-disabled="userform.userId.$dirty && userform.userId.$invalid ||
  						userform.userName.$dirty && userform.userName.$invalid ||
  						userform.phoneNum.$dirty && userform.phoneNum.$invalid ||
  						userform.email.$dirty && userform.email.$invalid">
						保存
					</button>
				</div>
			</form>

		</div>
		<div class="modal-footer">
			<button type="button" class="btn btn-danger" data-dismiss="modal" ng-click="close()">关闭</button>
		</div>
	</div>
</div>